import React from "react"
import useCreation from "../../hooks/useCreation.ts"
import { useState } from "react"

const TryUseCreation = () => {
  const [flag, setFlag] = useState(false)

  const getNowDate = () => {
    return new Date().toLocaleString()
  }

  const memoData = useCreation(() => {
    return getNowDate()
  }, [])

  return (
    <div className='text-[46px]'>
      <div>Try UseCreation</div>
      <div>{getNowDate()}</div>
      <div>{memoData}</div>
      <button className='bg-[#ccc]' onClick={() => setFlag(!flag)}>
        Toggle
      </button>
      {flag && <div>Flag is true</div>}
    </div>
  )
}

export default TryUseCreation
